﻿using System;
using System.Linq;
using System.Linq.Expressions;

namespace GenericRepository.Infrastructure
{
    public interface IRepository 
    {
        IQueryable<T> GetAll<T>() where T : class ;

        IQueryable<T> Find<T>(Expression<Func<T, bool>> predicate) where T : class;

        T GetOne<T>(Expression<Func<T, bool>> predicate) where T : class;

        T GetByKey<T>(object id) where T : class;

        void Add<T>(T entity) where T : class;

        void Delete<T>(T entity) where T : class;

        void Delete<T>(IQueryable<T> entities) where T : class;

        void Update<T>(T entity) where T : class;

        int Count<T>() where T : class;

        IQueryable<T> GetQuery<T>() where T : class;

        IQueryable<T> GetQuery<T>(Expression<Func<T, bool>> predicate) where T : class;
    }
}